import 'package:flutter/material.dart';
import 'package:flutter_html/flutter_html.dart';
import 'package:mall/constants.dart';
import 'package:mall/core/models/store_index.dart';

class NewsDetailPage extends StatelessWidget {
  static const routeName = '/NewsDetailPage';
  final Link args;

  NewsDetailPage({
    Key key,
    @required this.args,
  }) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('详情'),
      ),
      body: SingleChildScrollView(
        child: Container(
          padding: EdgeInsets.symmetric(horizontal: 12),
          child: Html(data: args.content?.replaceAll(' src=\"/', ' src=\"$api_base_url/') ?? '--'),
        ),
      ),
    );
  }
}
